﻿@{
    //  var _timeZones = TimeZoneRepo.List();


    var _timeZones = TimeZoneInfo.GetSystemTimeZones();

    var _offset = TimeSpan.FromHours(ForumContext.Configuration.TimeZoneOffset).ToString();
          
}
<div class="widget w80 white-t">
    <div class="header">
        <span class="icon"></span>
        <h1>@ViewBag.ActiveUrl.Title</h1>
    </div>
    @*<form action="@ViewBag.ActiveUrl.Url" class="ajax {hashPwd:1}" id="_f">*@
    @using (Html.Kaio().BeginForm(new jQueryAjaxOptions { HashPwd = true, Loading = true },new {id="_f"}))
    {
        
        <div class="reg-panel">
            @Html.AntiForgeryToken()
            <input type="hidden" value="@ViewBag.ReturnUrl" name="returnUrl" />
            <table>
                <tr>
                    <td class="caption" colspan="2">
                        @ForumContext.GetText(LanguageSection.REGISTER, "REG_INFO")
                    </td>
                </tr>
                <tr>
                    <td class="table-cell width30">
                        @ForumContext.GetMvcText(LanguageSection.REGISTER, "USERNAME")
                    </td>
                    <td class="table-cell">
                        <input type="text" id="username" name="username" class="input {validate:{required:true}}" />
                    </td>
                </tr>
                <tr>
                    <td class="table-cell">
                        @ForumContext.GetMvcText(LanguageSection.REGISTER, "PWD")
                    </td>
                    <td class="table-cell">
                        <input type="password" name="pwd" id="pwd" class="input password-strength {validate:{required:true}}" />
                    </td>
                </tr>
                <tr>
                    <td class="table-cell">
                        @ForumContext.GetMvcText(LanguageSection.REGISTER, "REPWD")
                    </td>
                    <td class="table-cell">
                        <input type="password" name="repwd" id="repwd" class="input {validate:{required:true,equalTo:'#pwd'}}" />
                    </td>
                </tr>
                <tr>
                    <td class="table-cell">
                        @ForumContext.GetMvcText(LanguageSection.REGISTER, "EMAIL")
                    </td>
                    <td class="table-cell">
                        <input type="text" name="email" id="email" class="input {validate:{required:true,email:true}}" />
                    </td>
                </tr>
                <tr>
                    <td class="table-cell">
                        @ForumContext.GetMvcText(LanguageSection.REGISTER, "CAPTCHA")
                    </td>
                    <td class="table-cell">
                        <div id="_recaptcha" class="recaptcha">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="caption">
                        @ForumContext.GetText(LanguageSection.REGISTER, "REGISTER_OPTIONS")
                    </td>
                </tr>
                <tr>
                    <td class="table-cell">
                        @ForumContext.GetMvcText(LanguageSection.REGISTER, "TIMEZONE"))
                    </td>
                    <td class="table-cell">
                        @Html.DropDownList("timezone", new SelectList(_timeZones.AsEnumerable(), "BaseUtcOffset", "DisplayName", _offset), new { @class = "select", @style = "min-width:220px" })
                    </td>
                </tr>
                <tr>
                    <td class="table-cell">
                        &nbsp;
                    </td>
                    <td class="table-cell">
                        @*<input type="submit" value="@ForumContext.GetText(LanguageSection.REGISTER, LanguageSection.REGISTER)" class="button" />*@
                        @Html.Link("javascript://", ForumContext.GetText(LanguageSection.REGISTER, "REGISTER"), new { @class = "ui-button", onclick = "$.MvcForum.ajaxSubmit('_f')" })
                    </td>
                </tr>
            </table>
        </div>
    }
</div>
@using (Html.BeginScriptBlock())
{
    
    <script type="text/javascript">
        $(function () {
            $('#username').bind("keyup", function () {
                var _val = $(this).val();
                $(this).val(_val.replace(/[^a-z0-9A-Z\-\_]/ig, ''));
            });

            $('input.password-strength').pwdStrength();

            $('#_recaptcha').recaptcha();
        })
    </script>
}
